Sorting reference lists

So, these are the macros I've got to play with --- how do we apply them to sorting lists of references? Well, I'm using LATEX, which keeps the current reference in a macro called 34, which is~#thissection#392> at the moment, as this is Section~#thissection#393>. So I just need to store the value of 35 somehow.

Fortunately, I'm only ever going to be making references to facts earlier on in the document, in order to make sure I'm not proving any results in terms of themselves. So I don't need to play around with auxiliary files, and can just do everything in terms of macros.